<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'company-form',
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'user_id'); ?>
		<?php echo $form->dropDownList(
			$model,
			'user_id', 
			CHtml::listData(User::getAllUser(), 'id', 'email'),
			array('prompt'=>' - User -'));
			//Yii::app()->user->defineCityByIp(), 
		?>
		<?php echo $form->error($model,'user_id'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'company_name'); ?>
		<?php echo $form->textField($model,'company_name',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'company_name'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'short_description'); ?>
		<?php $form->widget('application.extensions.ckeditor.CKEditorWidget',array(
				    "model"=>$model,                 # Data-Model
				    "attribute"=>'short_description',       # Attribute in the Data-Model
					"includeCkfinder" => false,		 # Include CKFINDER
				    "defaultValue"=>$model->short_description,     # Optional
				 
				    # Additional Parameter (Check http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html)
				    "config" => array(
				        "height"=>"200px",
				        "width"=>"100%",
				        "toolbar"=>"Basic",
						"skin"=>"office2003",
				        ),
				 
				    #Optional address settings if you did not copy ckeditor on application root
				    "ckEditor"=>Yii::app()->basePath."/../ckeditor/ckeditor.php",
				                                    # Path to ckeditor.php
				    "ckBasePath"=>Yii::app()->baseUrl."/ckeditor/",
				                                    # Realtive Path to the Editor (from Web-Root)
    	) ); ?>
		<?php echo $form->error($model,'shot_description'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'description'); ?>
		<?php $form->widget('application.extensions.ckeditor.CKEditorWidget',array(
				    "model"=>$model,                 # Data-Model
				    "attribute"=>'description',       # Attribute in the Data-Model
					"includeCkfinder" => false,		 # Include CKFINDER
				    "defaultValue"=>$model->description,     # Optional
				 
				    # Additional Parameter (Check http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html)
				    "config" => array(
				        "height"=>"200px",
				        "width"=>"100%",
				        "toolbar"=>"Basic",
						"skin"=>"office2003",
				        ),
				 
				    #Optional address settings if you did not copy ckeditor on application root
				    "ckEditor"=>Yii::app()->basePath."/../ckeditor/ckeditor.php",
				                                    # Path to ckeditor.php
				    "ckBasePath"=>Yii::app()->baseUrl."/ckeditor/",
				                                    # Realtive Path to the Editor (from Web-Root)
    	) ); ?>
		<?php echo $form->error($model,'description'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'website'); ?>
		<?php echo $form->textField($model,'website',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'website'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'person_name'); ?>
		<?php echo $form->textField($model,'person_name',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'person_name'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'person_phone'); ?>
		<?php echo $form->textField($model,'person_phone',array('size'=>45,'maxlength'=>45)); ?>
		<?php echo $form->error($model,'person_phone'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'person_email'); ?>
		<?php echo $form->textField($model,'person_email',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'person_email'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'address'); ?>
		<?php echo $form->textArea($model,'address',array('rows'=>6, 'cols'=>50)); ?>
		<?php echo $form->error($model,'address'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'is_active'); ?>
		<?php echo $form->checkBox($model,'is_active'); ?>
		<?php echo $form->error($model,'is_active'); ?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->